// AUSlotsGutsPayouts.H : Declaration of the CAUSlotsGutsPayouts class

#ifndef __AUSLOTSGUTSPAYOUTS_H_
#define __AUSLOTSGUTSPAYOUTS_H_

class CAUSlotsGutsMaxPayoutAccessor
{
public:
	LONG m_gutsid;
	BYTE m_MaxPayoutTypeID;

BEGIN_COLUMN_MAP(CAUSlotsGutsMaxPayoutAccessor)
	COLUMN_ENTRY(1, m_MaxPayoutTypeID)
END_COLUMN_MAP()

BEGIN_PARAM_MAP(CAUSlotsGutsMaxPayoutAccessor)
	COLUMN_ENTRY(1, m_gutsid)
END_PARAM_MAP()

DEFINE_COMMAND_EX(CAUSlotsGutsMaxPayoutAccessor, L" \
	SELECT \
		MAX(payouttypeid) AS MaxPayoutTypeID \
	FROM dbo.AUSlotsGutsPayouts \
	WHERE gutsid = ?")

	// You may wish to call this function if you are inserting a record and wish to
	// initialize all the fields, if you are not going to explicitly set all of them.
	void ClearRecord()
	{
		memset(this, 0, sizeof(*this));
	}
};

class CAUSlotsGutsMaxPayout : public CCommand<CAccessor<CAUSlotsGutsMaxPayoutAccessor> >
{
public:
	HRESULT Open( CSession* pSession )
	{
		return CCommand<CAccessor<CAUSlotsGutsMaxPayoutAccessor> >::Open(*pSession);
	}
};

class CAUSlotsGutsPayoutsAccessor
{
public:
	LONG m_gutsid;
	BYTE m_payouttypeid;
	TCHAR m_payoutname[65];
	LONG m_payoutAmount;

BEGIN_COLUMN_MAP(CAUSlotsGutsPayoutsAccessor)
	COLUMN_ENTRY(1, m_payouttypeid)
	COLUMN_ENTRY(2, m_payoutname)
	COLUMN_ENTRY(3, m_payoutAmount)
END_COLUMN_MAP()

BEGIN_PARAM_MAP(CAUSlotsGutsPayoutsAccessor)
	COLUMN_ENTRY(1, m_gutsid)
END_PARAM_MAP()

DEFINE_COMMAND_EX(CAUSlotsGutsPayoutsAccessor, L" \
	SELECT \
		payouttypeid, \
		payoutname, \
		payoutAmount  \
	FROM dbo.AUSlotsGutsPayouts \
	WHERE gutsid = ?")

	// You may wish to call this function if you are inserting a record and wish to
	// initialize all the fields, if you are not going to explicitly set all of them.
	void ClearRecord()
	{
		memset(this, 0, sizeof(*this));
	}
};

class CAUSlotsGutsPayouts : public CCommand<CAccessor<CAUSlotsGutsPayoutsAccessor> >
{
public:
	HRESULT Open( CSession* pSession )
	{
		return CCommand<CAccessor<CAUSlotsGutsPayoutsAccessor> >::Open(*pSession);
	}
};

#endif // __AUSLOTSGUTSPAYOUTS_H_
